import request from '@/utils/request';

/**
 * 查询用户信息列表
 * @param query
 * @returns {*}
 */

export const listUser = (query) => {
  return request({
    url: '/bykt/user/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询用户信息详细
 * @param userId
 */
export const getUser = (userId: string | number) => {
  return request({
    url: '/bykt/user/' + userId,
    method: 'get'
  });
};

/**
 * 新增用户信息
 * @param data
 */
export const addUser = (data) => {
  return request({
    url: '/bykt/user',
    method: 'post',
    data: data
  });
};

/**
 * 修改用户信息
 * @param data
 */
export const updateUser = (data) => {
  return request({
    url: '/bykt/user',
    method: 'put',
    data: data
  });
};

/**
 * 删除用户信息
 * @param userId
 */
export const delUser = (userId: string | number | Array<string | number>) => {
  return request({
    url: '/bykt/user/' + userId,
    method: 'delete'
  });
};
